package notificacionesuno.conexion.factory;

import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;

public class Connection {

    public static java.sql.Connection connectDB() {
        java.sql.Connection connection = null;
        try {
            Class.forName("oracle.jdbc.driver.OracleDriver");
        } catch (ClassNotFoundException e) {
            System.out.println("No se encontró Driver de conexión");
        }

        try {
            DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
            System.out.println("Connecting to the database...");
            connection = DriverManager.getConnection(
                    "jdbc:oracle:thin:@localhost:1521:orcl", "scott", "tiger");
        } catch (Exception e) {
            System.out.println("The exception raised is:" + e);
        }
        return connection;
    }
}